<!-- include tpl=head_lay -->
<form method="post" class="layui-form" id="catesubmit">
<!-- if $id && $rs --><input type="hidden" name="id" id="id" value="{$rs.id}" /><!-- /if -->
<div class="layui-card">
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">{lang分类名称}</label>
			<div class="layui-input-inline default-auto">
				<input type="text" name="title" id="title" value="{$rs.title}" class="layui-input">
			</div>
			<div class="layui-form-mid layui-word-aux">{lang请设置附件分类名称，如图片库，影音库等，以方便管理}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">{lang存储目录}</label>
			<div class="layui-input-inline default-auto">
				<input type="text" name="root" id="root" value="{$rs.root}" class="layui-input">
			</div>
			<div class="layui-form-mid layui-word-aux">{lang相对于程序的根目而设，建议设置在res/之下的目录}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">{lang子文件夹}</label>
			<div class="layui-input-inline default-auto">
				<select name="folder">
					<option value="">{lang不创建文件夹}</option>
					<option value="Ym/d/"{if $rs.folder == 'Ym/d/'}selected{/if}>{lang年月/日/，示例} {func date Ym/d/}</option>
					<option value="Y/m/d/"{if $rs.folder == 'Y/m/d/'}selected{/if}>{lang年/月/日/，示例} {func date Y/m/d/}</option>
					<option value="Ymd/"{if $rs.folder == 'Ymd/'}selected{/if}>{lang年月日/，示例} {func date Ymd/}</option>
					<option value="Y/m/"{if $rs.folder == 'Y/m/'}selected{/if}>{lang年/月/，示例} {func date Y/m/}</option>
					<option value="Y/"{if $rs.folder == 'Y/'}selected{/if}>{lang年/，示例} {func date Y/}</option>
				</select>
			</div>
			<div class="layui-form-mid layui-word-aux">{lang设置是否创建子文件夹}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang存储接口}
			</label>
			<div class="layui-input-inline default-auto">
				<select name="etype" id="etype" lay-filter="etype">
					<option value="0">{lang本地存储}</option>
					<!-- loop from=$osslist key=$key value=$value id=$tmpid -->
					<option value="{$value.id}"{if $value.id == $rs.etype} selected{/if}>{$value.title}</option>
					<!-- /loop -->
				</select>
			</div>
			<div class="layui-form-mid">
				{lang启用云存储后，本地不保存资源}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang上传方式}
			</label>
			<div class="layui-input-inline default-auto">
				<select id="upload_binary" name="upload_binary">
					<option value="0">{lang传统上传方式}</option>
					<option value="1"{if $rs.upload_binary} selected{/if}>{lang使用二进制上传}</option>
				</select>
			</div>
			<div class="layui-form-mid layui-word-aux">
				{lang仅限本地存储，上传方式才是有效的}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">{lang是否默认}</label>
			<div class="layui-input-inline auto">
				<input type="checkbox" name="is_default" id="is_default" lay-skin="switch" value="1" {if $rs.is_default} checked{/if}>
			</div>
			<div class="layui-form-mid layui-word-aux">{lang当前端或未指定附件分类时，将使用这个默认来读取。整个附件分类管理中仅限支持一个}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">{lang附件类型}</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="filetypes" name="filetypes" value="{$rs.filetypes}" class="layui-input">
			</div>
			<div class="layui-form-mid layui-word-aux">{lang多种附件类型用英文逗号隔开，如jpg,gif,png，以此类推}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">{lang类型说明}</label>
			<div class="layui-input-inline auto">
				<input type="text" id="typeinfo" name="typeinfo" value="{$rs.typeinfo}" class="layui-input">
			</div>
			<div class="layui-form-mid layui-word-aux">{lang描述附件类型信息，如jpg,gif,png，可以描述为图片，rar,zip等可以描述为压缩文件}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">{lang大小限制}</label>
			<div class="layui-input-inline short">
				<input type="text" id="filemax" name="filemax" value="{$rs.filemax}" class="layui-input">
			</div>
			<div class="layui-form-mid layui-word-aux">{lang设置单个文件大小，单位是KB，只需填写数值}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang图片压缩}
			</label>
			<div class="layui-input-inline default-auto">
				<select id="compress" name="compress">
					<option value="0">{lang不压缩}</option>
					<option value="500"{if $rs.compress == 500} selected{/if}>{lang压缩图片宽度不小于} 500px</option>
					<option value="700"{if $rs.compress == 700} selected{/if}>{lang压缩图片宽度不小于} 700px</option>
					<option value="800"{if $rs.compress == 800} selected{/if}>{lang压缩图片宽度不小于} 800px</option>
					<option value="900"{if $rs.compress == 900} selected{/if}>{lang压缩图片宽度不小于} 900px</option>
					<option value="1000"{if $rs.compress == 1000} selected{/if}>{lang压缩图片宽度不小于} 1000px</option>
					<option value="1200"{if $rs.compress == 1200} selected{/if}>{lang压缩图片宽度不小于} 1200px</option>
					<option value="1500"{if $rs.compress == 1500} selected{/if}>{lang压缩图片宽度不小于} 1500px</option>
					<option value="1700"{if $rs.compress == 1700} selected{/if}>{lang压缩图片宽度不小于} 1700px</option>
					<option value="1800"{if $rs.compress == 1800} selected{/if}>{lang压缩图片宽度不小于} 1800px</option>
					<option value="1920"{if $rs.compress == 1920} selected{/if}>{lang压缩图片宽度不小于} 1920px</option>
					<option value="2560"{if $rs.compress == 2560} selected{/if}>{lang压缩图片宽度不小于} 2560px</option>
					<option value="4000"{if $rs.compress == 4000} selected{/if}>{lang压缩图片宽度不小于} 4000px</option>
				</select>
			</div>
			<div class="layui-form-mid layui-word-aux">
				{lang仅限有图片时才执行，注意，这里压缩的是原图}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">{lang图片方案}</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="gdall" title="{lang全部使用}" lay-filter="gdall" value="1"{if $rs.gdall} checked{/if} />
				<input type="radio" name="gdall" title="{lang自定义使用}" lay-filter="gdall" value="0"{if !$rs.gdall} checked{/if} />
			</div>
			<div class="layui-form-mid layui-word-aux">{lang即上传到该分类下的图片，是否使用GD配置生成特定的图片规格}</div>
		</div>
		<div class="layui-form-item" id="gdsetting">
			<label class="layui-form-label">{lang定制方案}</label>
			<div class="layui-input-inline default-auto">
				<table class="layui-table">
					<colgroup>
						<col width="150">
						<col width="200">
					</colgroup>
					<thead>
					<tr>
						<th>{lang标识}</th>
						<th>{lang规格}</th>
					</tr>
					</thead>
					<tbody>
					<!-- loop from=$gdlist key=$key value=$value id=$tmpid -->
					<tr>
						<td><input type="checkbox" name="gdtypes[]" id="gdtypes{$value.id}" title="{$value.title ? $value.title : $value.identifier}" value="{$value.id}"{if in_array($value.id,$rs.gdtypes)} checked{/if} lay-skin="primary" /> </td>
						<td><label for="gdtypes{$value.id}">{$value.width ? $value.width : '自动判定'} x {$value.height ? $value.height : '自动判定'}</label></td>
					</tr>
					<!-- /loop -->
					</tbody>
				</table>
			</div>
			<div class="layui-form-mid layui-word-aux">{lang全部不选表示不使用GD方案}</div>
		</div>
		<input type="hidden" name="ico" value="1" />
		<div class="layui-form-item">
			<label class="layui-form-label">{lang前台可用}</label>
			<div class="layui-input-inline auto">
				<input type="checkbox" name="is_front" id="is_front" lay-skin="switch" value="1" {if $rs.is_front} checked{/if}>
			</div>
			<div class="layui-form-mid layui-word-aux">{lang设为前台可用时，在用户中心会显示相应的媒体库}</div>
		</div>
	</div>
</div>
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang提交}" class="layui-btn layui-btn-lg layui-btn-danger" />
		<input type="button" value="{lang取消关闭}" class="layui-btn layui-btn-lg layui-btn-primary" onclick="$.admin.close()" />
	</div>
</div>
</form>
<!-- include tpl=foot_lay -->